import 'package:flutter_basic/basic/basic_controller.dart';
import 'package:flutter_basic/multi_engine/snake_channel.dart';
import 'package:get/get.dart';

class MineController extends BasicController {
  final bool inTheTab;
  MineController({this.inTheTab = true});

  RxInt number = 10.obs;

  RxBool canBack = false.obs;
  RxString argument = ''.obs;
  @override
  void onInit() async{
    bool isFirst = Get.rawRoute!.isFirst;
    canBack.value = isFirst && !inTheTab;
    super.onInit();
    if(canBack.value) {
      Map<String, dynamic> result = await SnakeChannel().getInitialRouteInfo();
      String arguments = result['arguments'];
      argument.value = arguments;
    }
  }

  @override
  void onReady() {
    super.onReady();

  }
}